﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BestBuy.DAL
{
    public class cBangTinBan
    {
        public static void AddSellOffer(BangTinBan tb)
        {
            TradeKeyDataContext context = new TradeKeyDataContext();
            context.BangTinBans.InsertOnSubmit(tb);
            context.SubmitChanges();
        }
        public static int getIdBangtin(int iduser)
        {
            TradeKeyDataContext context = new TradeKeyDataContext();
            return (from n in context.BangTinBans where n.IDTaiKhoan == iduser select n.IDBangTinBan).Max();
        }
        public static void AddCategorySell(DanhMucBan dmb)
        {
            TradeKeyDataContext context = new TradeKeyDataContext();
            context.DanhMucBans.InsertOnSubmit(dmb);
            context.SubmitChanges();
        }
    }
}